<?php
/**
 * 日志
 * User: ws
 * Date: 2018/8/20
 * Time: 15:55
 */

namespace app\admin\model;
use think\Model;

class Log  extends Model
{
    protected $autoWriteTimestamp = true;

    public function setIpAttr()
    {
        return get_client_ip();
    }


    function add($params){
        $result = $this->isUpdate(false)->allowField(true)->save($params);
        if($result){
            return 1;
        }else{
            return false;
        }
    }

}